home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1998 April
/
EnigmA AMIGA RUN 26 (1998)(G.R. Edizioni)(IT)[!][issue 1998-04].iso
/
classx
/
util
/
xfa_util
/
arexx
/
adpro_animtoxfa_zoom.rexx
next >
Wrap
OS/2 REXX Batch file
|
1998-03-09
|
5KB
|
110 lines
/*
** Anim To XFA REQ ZOOM - ADPro Arexx Script Converter
**
** This code shows how to open a File Requester
** For setting Input Anim Name and Output Anim Name.
**
** ADPro could also be used for creating great effects.
** Here we will perform a "zooming" effect.
**
** This code (C)Copyright Fabio Rotondo.
** It is given as Freeware example and may not be used
** for any commercial product.
**
*/
ADDRESS "XFA.1" /* Let's ADDRESS XFA */
CountFormat ""
SetPath ADPro "ADPro:ADPro" /* Set ADPro Path */
CallProcessor ADPro /* Call ADPro */
ADDRESS "ADPro" /* Let's ADDRESS ADPro */
LFORMAT "ANIM" /* InputFile is an ANIM File */
SFORMAT "IFF" /* We have to save it as an IFF */
INTERFACE_SIZE TINY
OPTIONS RESULTS
sparename = "T:Frame" /* Name of file to be processed */
/* Here we ask for an Anim File name for input */
GETFILE '"Select An Anim File To Convert"'
IF RC = 10 THEN abort() /* If user press cancel, we abort the script */
animname = ADPRO_RESULT /* We store ANIM file name into animname */
/* Here we ask for a Output XFA Anim File Name for output */
GETFILE '"Save XFA Anim as..."'
IF RC = 10 THEN exit /* Same as Above...*/
outname = ADPRO_RESULT
frames = 0 /* Number of frames of the Anim */
LOAD animname COUNT /* Let's count the Anim Frames */
frames = ADPRO_RESULT-2 /* frames = ADPro's Result */
LOAD animname FRAME 1 /* Now we load the 1st Frame */
EXECUTE /* We render it into ADPro */
PSTATUS LOCKED /* And Lock The Palette next */
/* Frames will be remapped is */
/* We need it. (Multi pal anims)*/
SAVE sparename||0 IMAGE /* Save it into T:Frame0 */
ADDRESS "XFA.1" /* Now we call XFA (port is XFA.1) */
FirstFrame 0 /* We Set FirstFrame to 0 */
LastFrame frames /* We Set LastFrame to Anim Frames */
Compression 32I /* Set Compression to 32I */
CloseAnim LOOP /* Set AnimClose Mode to LOOP */
InputName sparename /* Input Root Name is T:Frame */
OutputName outname /* XFA Animation Name will be T:a.xfa */
SetProcessor ADPro /* We Select ImageProcessor Program */
InitXFA /* XFA Initialization */
/* NOTE: BEFORE call InitXFA you have */
/* To perform AT LEAST all settings */
/* We have done inside this example. */
/* Also remember of having the FIRST */
/* Frame of the ANIM saved as IFF, for*/
/* Configuring correctly XFA */
zoomdelta = 100/frames /* Here we calculate the difference from */
/* One frame to another. The Effect will */
/* Be a zoom from 0% to 100% image size. */
zoomval = zoomdelta
DO t=1 TO frames-1 /* For t=1 TO NFrames... */
ADDRESS "ADPro" /* Call ADPro */
LOAD animname FRAME t /* Load Frame N */
PCT_SCALE zoomval zoomval /* The Zoom!!! */
zoomval = zoomval + zoomdelta /* Next Frame Will Be Larger */
EXECUTE /* Render It */
x = t-1
n = sparename||x
SAVE n IMAGE /* Save Picture */
ADDRESS "XFA.1" /* Call XFA */
GetFrame (t-1) /* Load This Frame */
PutFrame /* Put It Inside Anim */
END /* Next */
ADDRESS "ADPro" /* Call ADPro */
LOAD animname FRAME frames /* Load The LAST Frame */
EXECUTE /* Render It */
x = frames-1
n = sparename||x
SAVE n IMAGE /* Save Picture */
ADDRESS "XFA.1" /* Call XFA */
GetFrame (t-1) /* Load This Frame */
PutFrame /* Put It Inside Anim */
CloseXFA /* Here We Close XFA Anim*/
Message '"Conversion done."'
exit /* End Of Arexx Script!! */
abort:
ADDRESS "XFA.1"
Message '"Operation Aborted By The User."'
exit(0)